<!DOCTYPE html>
<html>

<head lang="en">
    <meta charset="UTF-8">
    <title>f循环</title>
</head>

<body>
    <script>
    //for循环

    for (var i = 1; i < 10; i++) {
        console.log(i);
    }

    //for循环嵌套
    for (var x = 1; x < 10; x++) {
        for (var y = 1; y < 10; y++) {
            console.log(x + "-" + y);
        }
    }
    //while循环
    var i = 1; //i=3;
    while (i < 3) {
        document.write(i + "<br/>");
        i++;
    }
    //do while循环
    var i = 1; //i=3;
    do {
        document.write(i + "<br/>");
        i++;
    } while (i < 3)
    </script>
</body>

</html>